-
Notifications
You must be signed in to change notification settings - Fork 2
add file menu action to clear project cache #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
When would a user clear the project cache? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. If we add logging at some point the except OSError
should emit something
it should be infrequent, but we've had some incompatibilities in cached files between versions so they needed to be cleared and regenerated. At some point I am going to add some version information into the cache so JABS can deal with this automatically. |
@keithshep I'm not convinced this is necessary I'm going to hold off on merging this. I think a better solution would be to add some versioning and validation of any cached file in the project directory, and invalidate anything missing this versioning (so all cached files created by previous versions of JABS would be re-generated) |
It's hit us before (e.g. #4), which happened to be working with v5 files. I know there's a version for features and re-generating those, but it looks like the cache version numbers are managed per-inherited class. A cursory glance shows that it's only present for v3 and v4, so since most of our recent stuff is v6 it's not being checked/managed. |
if result == QtWidgets.QMessageBox.Yes: | ||
self._project.clear_cache() | ||
# need to reload the current video to force the pose file to reload | ||
self._central_widget.load_video(self._project.video_path(self.video_list.selected_video)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if self._project.video_path(self.video_list.selected_video)
returns None
?
@@ -54,6 +55,12 @@ def _selection_changed(self, current, previous): | |||
""" signal main window that use changed selected video """ | |||
if current: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to have an else
branch for when current doesn't evaluate to True? e.g. Should self._selected_video
be set to None
?
adds an action in the File menu to clear a project cache
opens a dialog for the user to confirm
forces reload of the currently selected video so the pose is loaded from the original .h5 file